from wxpyview.display import *
import wx

class EventHandlers:
    def __init__(self, wxpyview_obj):
        self.wxpyview_obj = wxpyview_obj
        
    def OnCloseWindow(self, event):
        frame = self.wxpyview_obj.FindWidgetByName("menu_frame")
        frame.Destroy()
        
    def SetHandler(self):
        self.wxpyview_obj.SetEventHandler("menu_quit", wx.EVT_MENU, self.OnCloseWindow, "menu_frame")

obj = View()
obj.SimpleInit()
obj.Parse('menu.xml')

handler = EventHandlers(obj)
handler.SetHandler()

obj.Run()